﻿using BCEntity.OA.WorkflowActive.WorkflowActivityStep;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BCData.OA.WorkflowActivity.WorkflowActivityStep
{
    /// <summary>
    /// 工作流活动步骤
    /// </summary>
    public interface IWorkflowActivityStepData
    {

		#region  成员方法
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		/// <param name="workflowActivityStepId">工作流活动步骤Id</param>
		Task<bool> Exists(long workflowActivityStepId);
		/// <summary>
		/// 增加工作流活动步骤
		/// </summary>
		/// <param name="entity">工作流活动步骤信息</param>
		Task<WorkflowActivityStepEntity> Add(WorkflowActivityStepEntity entity);
		/// <summary>
		/// 更新工作流活动步骤状态为已激活
		/// </summary>
		/// <param name="entity">工作流活动步骤信息</param>
		Task<WorkflowActivityStepEntity> UpdateStepStatusToActivity(WorkflowActivityStepEntity entity);
		/// <summary>
		/// 更新工作流活动步骤状态为已完成
		/// </summary>
		/// <param name="entity">工作流活动步骤信息</param>
		Task<WorkflowActivityStepEntity> UpdateStepStatusToComplete(WorkflowActivityStepEntity entity);
		/// <summary>
		/// 修改步骤按钮显示条件
		/// </summary>
		/// <param name="entity">工作流活动步骤信息</param>
		/// <returns></returns>
		Task<WorkflowActivityStepEntity> UpdateStepButtonShowCondition(WorkflowActivityStepEntity entity);
		/// <summary>
		/// 删除工作流活动步骤
		/// </summary>
		/// <param name="workflowActivityStepId">工作流活动步骤Id</param>
		Task<bool> Delete(long workflowActivityStepId);
		/// <summary>
		/// 获取工作流活动步骤
		/// </summary>
		/// <param name="workflowActivityStepId">工作流活动步骤Id</param>
		Task<WorkflowActivityStepEntity> GetEntity(long workflowActivityStepId);
		/// <summary>
		/// 获取工作流活动步骤正在进行中的步骤信息
		/// </summary>
		/// <param name="workflowActivityId">工作流活动Id</param>
		Task<WorkflowActivityStepEntity> GetActivityEntity(long workflowActivityId);
		/// <summary>
		/// 检查工作流活动步骤正在进行中的步骤信息是否存在多个
		/// </summary>
		/// <param name="workflowActivityId">工作流活动Id</param>
		Task<bool> GetActivityStepMoreThanOne(long workflowActivityId);
		/// <summary>
		/// 获取工作流活动步骤列表
		/// </summary>
		/// <param name="workflowCode">工作流活动Code</param>
		Task<IEnumerable<WorkflowActivityStepEntity>> GetList(string workflowCode);
		/// <summary>
		/// 获取工作流活动步骤列表
		/// </summary>
		/// <param name="workflowActivityId">工作流活动Id</param>
		Task<IEnumerable<WorkflowActivityStepEntity>> GetList(long workflowActivityId);
		/// <summary>
		/// 获取工作流步骤为条件步骤的活动中列表
		/// </summary>
		Task<IEnumerable<WorkflowActivityStepEntity>> GetWorkflowStepConditionStatusActiveList();
		/// <summary>
		/// 获取工作流活动步骤分页列表
		/// </summary>
		/// <param name="start">开始时间</param>
		/// <param name="end">结束时间</param>
		/// <param name="sortName">排序字段</param>
		/// <param name="ascending">升序</param>
		/// <param name="pageIndex">当前页码</param>
		/// <param name="pageSize">每页数据条数</param>
		Task<(IEnumerable<WorkflowActivityStepEntity>, int)> Query(DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);

		#endregion

		/// <summary>
		/// 获取工作流特殊表单已审批完成待处理实例
		/// </summary>
		/// <returns></returns>
		Task<IDictionary<long, string>> GetWorkflowActivityStepSpecificFormDone();
	}
}
